Fix iptable rules when chain reference count is 0#5328
Fix iptable rules when chain reference count is 0#5328DaanHoogland merged 1 commit intoapache:4.15from
Conversation
Sometimes the chain reference count is 0 and in that case proper iptables rules are not applied. Because of this, ping fails. So check the reference count for the main chain and as well as -IN and -OUT chain as well
|
@rhtyd @weizhouapache please review |
GabrielBrascher
left a comment
There was a problem hiding this comment.
Code LGTM.
What do you think @weizhouapache @rhtyd @wido @DaanHoogland?
|
code lgtm. however I am more interested in what cause the issue. |
@weizhouapache I really dont know what caused the issue in first place. Do you want the entire file to be uploaded? its around 100MB |
| refs6 = int(execute("""ip6tables -n -L %s | awk '/%s(.*)references/ {gsub(/\(/, "") ;print $3}'""" % (brfw,brfw)).strip()) | ||
|
|
||
| if refs == 0: | ||
| if refs == 0 or refs_in == 0 or refs_out == 0: |
There was a problem hiding this comment.
Shouldn't we always have a drop as the catchall/default rule at the end of the chain?
There was a problem hiding this comment.
@rhtyd
which chain do you mean ? FORWARD, brfw, brfwin or brfwout ?
there are some DROP rules in FORWARD chain and vm chains (i-x-x-def and i-x-x-VM/i-x-x-VM-eg)
there is a component test which verify the iptables/ebtables rules on host
test/integration/component/test_multiple_nic_support.py
we can run the test as well.
@ravening |
|
@blueorangutan package |
|
@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
@weizhouapache this is all I found |
|
@ravening can you please upload the logs near this timeslot ? |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 908 |
|
@ravening is there any log between and ? |
@weizhouapache nope .. no other logs in between |
weizhouapache
left a comment
There was a problem hiding this comment.
lgtm , based on the component test test_multiple_nic_support.py
Create Vm with multiple NIC's ... === TestName: test_01_create_vm_with_multiple_nics | Status : SUCCESS ===
ok
Create VM with single NIC and then add additional NIC ... === TestName: test_02_add_nic_to_vm | Status : SUCCESS ===
ok
Add secondary IP's to the VM ... === TestName: test_03_add_ip_to_default_nic | Status : SUCCESS ===
ok
Add secondary IP's to remaining NIC's ... === TestName: test_04_add_ip_to_remaining_nics | Status : SUCCESS ===
ok
Stop and Start a VM with Multple NIC ... === TestName: test_05_stop_start_vm_with_multiple_nic | Status : SUCCESS ===
ok
Migrate a VM with Multple NIC ... === TestName: test_06_migrate_vm_with_multiple_nic | Status : SUCCESS ===
ok
Remove secondary IP from any NIC ... === TestName: test_07_remove_secondary_ip_from_nic | Status : SUCCESS ===
ok
Remove NIC from VM ... === TestName: test_08_remove_nic_from_vm | Status : SUCCESS ===
ok
Reboot a VM with Multple NIC ... === TestName: test_09_reboot_vm_with_multiple_nic | Status : SUCCESS ===
ok
----------------------------------------------------------------------
Ran 9 tests in 320.685s
OK
Description
Sometimes the chain reference count is 0 and in that case
proper iptables rules are not applied. Because of this, ping fails.
So check the reference count for the main chain and as well as
-IN and -OUT chain as well
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
Before the fix
Iptable rules on NON working node
The iptables-save command is missing bond rule
iptable rules on WORKING node
After the fix
iptable rules from the security_group.log file
How Has This Been Tested?